﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace PRE.catalog
{
    public partial class FrmXemlichsubenh : DevExpress.XtraEditors.XtraForm
    {
        DAL.XemlichsubenhDAL _dal  = new DAL.XemlichsubenhDAL();
        public FrmXemlichsubenh()
        {
            InitializeComponent();
        }

        private void FrmXemlichsubenh_Load(object sender, EventArgs e)
        {
            //cbomabn.Properties.DataSource = _dal.select_benhnhan();
            //string id = (cbomabn.EditValue + "").Trim();
            DataTable _dtb = _dal.Lichsubenhnhan(_mabn);


            if (_dtb != null)
            {
                grcMain.DataSource = _dtb;
            }

        }

        private void cbomabn_EditValueChanged(object sender, EventArgs e)
        {
           // string id = (cbomabn.EditValue + "").Trim();
            //DataTable _dtb = _dal.Lichsubenh(id);


            //if (_dtb != null)
            //{
              //  grcMain.DataSource = _dtb;
            //}
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        //private void cbomabn_SelectedIndexChanged(object sender, EventArgs e)
        //{
            
        //    string id = (cbomabn.EditValue + "").Trim();
        //    DataTable _dtb = _dal.Lichsubenh(id);


        //    if (_dtb != null)
        //    {
        //        grcMain.DataSource = _dtb;
        //    }
        //}
        public string _mabn;

        private void dockPanel2_Click(object sender, EventArgs e)
        {

        }

        //private void simpleButton2_Click(object sender, EventArgs e)
        //{
            
        //   // string matrangthai =cboMATRANGTHAI.EditValue+ "";
        //    DataTable dtb_report = _dal.Lichsubenhnhan();

        //    var frm = new Report.Report_Base();
        //    var xr = new Report.XRLichsubenhnhan();

        //    xr.DataSource = dtb_report;
        //    frm.SetReport(xr);

        //    frm.Show();
        //}

        }
    }
